package com.manong.controller;


import com.manong.entity.AttendanceManagement;
import com.manong.entity.SysFinancialExpenses;
import com.manong.service.AttendanceManagementService;
import com.manong.utils.Result;
import com.manong.vo.CommonReqVo;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 出勤管理
 */
@RestController//使用该注解，使得每个方法的返回值都会以json或xml的形式直接导入http响应体中
@RequestMapping("/api/attendance")
@RequiredArgsConstructor
public class AttendanceManagementController {

    private final AttendanceManagementService attendanceManagementService;


    @PostMapping("/list")
    public Result list(@RequestBody CommonReqVo commonReqVo) {
        return Result.ok(attendanceManagementService.listAll(commonReqVo)).message("出勤信息查询成功");
    }

    @PostMapping("/save")
    public Result save(@RequestBody AttendanceManagement attendanceManagement) {
        return Result.ok(attendanceManagementService.save1(attendanceManagement)).message("出勤信息更新成功");
    }

    @PostMapping("/delete")
    public Result delete(@RequestBody CommonReqVo commonReqVo) {
        return Result.ok(attendanceManagementService.delete1(commonReqVo)).message("出勤信息删除成功");
    }

}
